# --------------------------------------------------
# -*- coding: utf-8 -*-
# Time: 2023/3/11 14:50
# Author: 沈凌鹏
# Version: 0.1
# File: calculator_demo.py
# Description: 极简计算器代码实现
# --------------------------------------------------

class Calculator:

    # 加法
    def add(self, x, y):
        return x + y

    # 减法
    def subtract(self, x, y):
        return x - y

    # 乘法
    def multiply(self, x, y):
        return x * y

    # 除法
    def divide(self, x, y):
        if y == 0:
            return 'error'
        else:
            return x / y
